﻿
@using xiushen.Infrastructure
@model IEnumerable<xiushen.Domain.Category>
@foreach (var data in Model)
{
   
    if (data.Type == Constants.Video)
    {
        var videos = data.Videos.Take(20);
        
            <div class="row alert margin-top">
        <div class="span2"><strong>@data.Name</strong></div>
        <div class="span2"><a href="@Url.Action("MoreVideos", new { categoryId = data.ID })">查看更多</a></div>
    </div>
    <div class="row margin-top">
        @foreach (var v in videos)
        {
   
            <div class="span2">
                <div class="videolist">
                      <a href="@Url.Action("ViewVideos", new { categoryId = v.CategoryID, id = v.ID })">
                    <img src="@v.PicURL"/> 
                </a> 
               <div class="stitle">  <a href="@Url.Action("ViewVideos", new { categoryId = v.CategoryID, id = v.ID })">@v.Name   </a> </div> 
                </div>
              
            </div>
        }
    </div>
    }
    else  if (data.Type == Constants.Book)
    {
        var books = data.Book.Take(20);
        if (books.Count() > 0)
        {
             <div class="row alert margin-top">
        <div class="span2"><strong>@data.Name</strong></div>
        <div class="span2"><a href="@Url.Action("MoreBooks", new { categoryId = data.ID })">查看更多</a></div>
    </div>
        }
   
    <div class="row">
        @foreach (var book in books)
        {
            var hasContent = !string.IsNullOrEmpty(book.DirectContent);
            var actionName = "Chapters";
            if (hasContent)
            {
                actionName = "BookContent";
            }
   
        <div class="span3">
            <a href="@Url.Action(actionName, new { bookId = book.ID, categoryId = data.ID })" >@book.Name</a></div>
        }
    </div>
    }
  
}
@*/http://user.qzone.qq.com/562390523*@
<img src="http://b201.photo.store.qq.com/psu?/115ef91e-5bb1-40fc-8d49-ae7affe7fa6c/jxyGjo3qLq7vdJYkRGg9Xu3ZFR38nTxXwhx2WMLvw5U!/b/YQLM0neDowAAYlaN43dxogAAbyPq23eHogAA&bo=GQIgA1sDWwMBAB8!"/ >
